package com.day4;

import java.util.Random;
import java.util.Scanner;

public class Day4zuoye3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        System.out.println("请输入班级人数:");
        int count=sc.nextInt();
        int[] arr = new int[count];
        int bujige=0,sum=0,max=0;
        for (int i = 0; i <arr.length ; i++) {
            arr[i]=r.nextInt(100)+1;
            System.out.print(arr[i]+" ");
        }
        System.out.println();
        System.out.print("不及格:");

        for (int i = 0; i <arr.length; i++) {
            if (arr[i]<60){
                System.out.print(+arr[i]+" ");
                bujige++;
            }else if (arr[i]>max){
                max=arr[i];
            }

            sum+=arr[i];
        }
        System.out.println("不及格人数:"+bujige);
        System.out.println("总分"+sum);
        System.out.println("平均分:"+sum/(arr.length+1));
        System.out.println("最高分是:"+max);
    }
}
